package cn.trs.common.enums;

/**
 * 通用成功码枚举
 *
 * @author 王元晨
 */
public enum SuccCodeEnum {

    // 通用成功
    DATA_SUCC("1", "OK"),
    ;

    private final String code;
    private final String message;

    public String getCode() {
        return code;
    }

    public String getMessage() {
        return message;
    }

    SuccCodeEnum(String code, String message) {
        this.code = code;
        this.message = message;
    }

    public static String getCodeMessage(String code){
        for (SuccCodeEnum succCodeEnum : SuccCodeEnum.values()) {
            if (code.equals(succCodeEnum.getCode())) {
                return succCodeEnum.getMessage();
            }
        }
        return null;
    }

}
